#ifndef SWEGL_VIEWPORT_H
#define SWEGL_VIEWPORT_H

namespace swegl
{

class Viewport
{
public:
	Viewport();
	Viewport(uint x, uint y, uint width, uint height);
	
	uint x;
	uint y;
	uint width;
	uint height;
};

inline Viewport::Viewport() :
	x(0),
	y(0),
	width(0),
	height(0)
{
}

inline Viewport::Viewport(uint x, uint y, uint width, uint height) :
	x(x),
	y(y),
	width(width),
	height(height)
{
}


class ClippingViewport
{
public:
	ClippingViewport();
	explicit ClippingViewport(const Viewport &viewport);
	
	float left, right, top, bottom;
};

inline ClippingViewport::ClippingViewport() :
	left(0),
	right(0),
	top(0),
	bottom(0)
{
}

inline ClippingViewport::ClippingViewport(const Viewport &viewport) :
	left(static_cast<float>(viewport.x)),
	right(static_cast<float>(viewport.x + viewport.width)),
	top(static_cast<float>(viewport.y)),
	bottom(static_cast<float>(viewport.y + viewport.height))
{
}

}

#endif
